package com.sg.service.base.app.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sg.common.util.CommonFunctionHelper;
import com.sg.dto.base.app.req.*;
import com.sg.entity.OmsExecuteCycleStage;
import com.sg.service.base.app.MOmsExecuteCycleStageService;
import com.wicket.okrapp.common.dto.FieldInfo;
import com.wicket.okrapp.common.exception.BizException;
import com.wicket.okrapp.dal.mapper.mbg.OmsExecuteCycleStageMapper;
import com.wicket.okrframework.common.annotations.BanAuto;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author ：
 * @version 1.0
 * @since 2022/1/19 15:39
 */
@Service
public class MOmsExecuteCycleStageServiceImpl
        extends ServiceImpl<OmsExecuteCycleStageMapper, OmsExecuteCycleStage>
        implements MOmsExecuteCycleStageService {

    @Autowired
    OmsExecuteCycleStageMapper omsExecuteCycleStageMapper;

    /**
     * 3-3-07批量查执行周期列表（by执行周期ID）[2194]
     * gen by moon at 7/7/2024, 11:53:27 AM
     */
    @Trace(operationName = "3-3-07批量查执行周期列表（by执行周期ID）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> batchQueryTargetCycleList(BatchQueryTargetCycleListReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            reqDto.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
            if (reqDto.getExecuteCycleStageList() == null || reqDto.getExecuteCycleStageList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("execute_cycle_stage_id", reqDto.getExecuteCycleStageList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByDesc("order_number");
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07批量查询内容匹配汇报周期[2208]
     * gen by moon at 4/25/2023, 7:37:36 PM
     */
    @Trace(operationName = "3-3-07批量查询内容匹配汇报周期")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> batchQueryContMatchReportCycle(BatchQueryContMatchReportCycleReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            reqDto.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
            if (reqDto.getExecuteCycleStageList() == null || reqDto.getExecuteCycleStageList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("relate_content_id", reqDto.getExecuteCycleStageList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByDesc("eva_temp_create_time");
            queryWrapper.orderByDesc("order_number");
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07查询周期阶段匹配汇报周期列表[2236]
     * gen by moon at 10/16/2022, 7:13:22 AM
     */
    @Trace(operationName = "3-3-07查询周期阶段匹配汇报周期列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @BanAuto
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> queryCycStaMatchReportCycleList(QueryCycStaMatchReportCycleListReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            reqDto.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByDesc("order_number");
            queryWrapper.orderByAsc("eva_temp_create_time");
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07新增执行周期阶段[2354]
     * gen by moon at 5/15/2023, 10:14:05 PM
     */
    @Trace(operationName = "3-3-07新增执行周期阶段")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public String addExecuteCycleStage(OmsExecuteCycleStage omsExecuteCycleStage) {
        omsExecuteCycleStage.setExecuteCycleStageId(CommonFunctionHelper.getUid());//DISTRIBUTED_ID
        omsExecuteCycleStage.setIsArchive("FALSE");
        omsExecuteCycleStage.setSubjectLifeCycle("CURRENTLY_VALID");
        omsExecuteCycleStage.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        omsExecuteCycleStage.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        if (omsExecuteCycleStage != null && omsExecuteCycleStage.getSubjectLifeCycle() != null && omsExecuteCycleStage.getSubjectLifeCycle().equals("CURRENTLY_VALID")) {
            omsExecuteCycleStage.setReleaseInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//RELEASED_CURRENT_INDUCTIONID
        }
        omsExecuteCycleStage.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        omsExecuteCycleStage.setCreateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        if (omsExecuteCycleStage != null && omsExecuteCycleStage.getSubjectLifeCycle() != null && omsExecuteCycleStage.getSubjectLifeCycle().equals("CURRENTLY_VALID")) {
            omsExecuteCycleStage.setReleaseTime(CommonFunctionHelper.getCurrentTime());//RELEASE_SYSTEM_CURRENT_TIME
        }
        omsExecuteCycleStage.setIsValid("FALSE");
        omsExecuteCycleStage.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
        omsExecuteCycleStage.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
        if (super.save(omsExecuteCycleStage)) {
            return omsExecuteCycleStage.getExecuteCycleStageId();
        } else {
            return "-1";
        }

    }

    /**
     * 3-3-07批量增目标周期[2358]
     * gen by moon at 10/16/2022, 7:13:24 AM
     */
    @Trace(operationName = "3-3-07批量增目标周期")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchAddTargetCycle(List<OmsExecuteCycleStage> omsExecuteCycleStage) {

        if (omsExecuteCycleStage == null || omsExecuteCycleStage.size() == 0) {
            return false;
        }

        return super.saveBatch(omsExecuteCycleStage.stream().map(item -> {
            item.setExecuteCycleStageId(CommonFunctionHelper.getUid());//DISTRIBUTED_ID
            item.setIsArchive("FALSE");
            item.setSubjectLifeCycle("EDITING");
            item.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
            item.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
            item.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
            item.setCreateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
            item.setIsValid("FALSE");
            item.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            item.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
            return item;
        }).collect(Collectors.toList()));
    }

    /**
     * 3-3-07查询执行周期阶段详情[2429]
     * gen by moon at 3/30/2023, 12:38:47 PM
     */
    @Trace(operationName = "3-3-07查询执行周期阶段详情")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsExecuteCycleStage queryExecuteCycleStageDetail(QueryExecuteCycleStageDetailReq reqDto) {

        try {
            reqDto.setIsValid("FALSE");
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsExecuteCycleStage> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsExecuteCycleStage retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07查询汇报周期阶段列表[2459]
     * gen by moon at 10/16/2022, 7:13:26 AM
     */
    @Trace(operationName = "3-3-07查询汇报周期阶段列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> queryReportCycleStageList(QueryReportCycleStageListReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            reqDto.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByDesc("order_number");
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07修改执行周期阶段[2489]
     * gen by moon at 12/2/2022, 3:36:50 AM
     */
    @Trace(operationName = "3-3-07修改执行周期阶段")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateExecuteCycleStage(OmsExecuteCycleStage omsExecuteCycleStage) {
        omsExecuteCycleStage.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        omsExecuteCycleStage.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        return super.updateById(omsExecuteCycleStage);
    }

    /**
     * 3-3-07批量改目标周期[2500]
     * gen by moon at 10/16/2022, 7:13:27 AM
     */
    @Trace(operationName = "3-3-07批量改目标周期")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchUpdateTargetCycle(List<OmsExecuteCycleStage> omsExecuteCycleStage) {

        if (omsExecuteCycleStage == null || omsExecuteCycleStage.size() == 0) {
            return false;
        }
        return super.saveOrUpdateBatch(omsExecuteCycleStage);

    }

    /**
     * 3-3-07批量删执行周期阶段[2743]
     * gen by moon at 10/16/2022, 7:13:28 AM
     */
    @Trace(operationName = "3-3-07批量删执行周期阶段")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchDeleteExecuteCycleStage(List<String> reqDto) {

        if (reqDto == null || reqDto.size() == 0) {
            return false;
        }

        return super.removeByIds(reqDto);
    }

    /**
     * 3-3-07批量查目标周期By内容主键[2809]
     * gen by moon at 10/16/2022, 7:13:29 AM
     */
    @Trace(operationName = "3-3-07批量查目标周期By内容主键")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> batchQueryTargetCycleByEntityId(BatchQueryTargetCycleByEntityIdReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            reqDto.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
            if (reqDto.getExecuteCycleStageList() == null || reqDto.getExecuteCycleStageList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("relate_content_id", reqDto.getExecuteCycleStageList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07批量查询执行周期阶段[3149]
     * gen by moon at 10/16/2022, 7:13:30 AM
     */
    @Trace(operationName = "3-3-07批量查询执行周期阶段")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> batchQueryExecuteCycleStage(BatchQueryExecuteCycleStageReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            reqDto.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
            if (reqDto.getExecuteCycleStageList() == null || reqDto.getExecuteCycleStageList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("cycle_id", reqDto.getExecuteCycleStageList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07批量改执行周期阶段[3150]
     * gen by moon at 10/16/2022, 7:13:31 AM
     */
    @Trace(operationName = "3-3-07批量改执行周期阶段")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchUpdateExecuteCycleStage(List<OmsExecuteCycleStage> omsExecuteCycleStage) {

        if (omsExecuteCycleStage == null || omsExecuteCycleStage.size() == 0) {
            return false;
        }
        return super.saveOrUpdateBatch(omsExecuteCycleStage);

    }

    /**
     * 3-3-07批量增执行周期阶段[3151]
     * gen by moon at 10/23/2022, 6:57:20 PM
     */
    @Trace(operationName = "3-3-07批量增执行周期阶段")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchAddExecuteCycleStage(List<OmsExecuteCycleStage> omsExecuteCycleStage) {

        if (omsExecuteCycleStage == null || omsExecuteCycleStage.size() == 0) {
            return false;
        }

        return super.saveBatch(omsExecuteCycleStage.stream().map(item -> {
            item.setExecuteCycleStageId(CommonFunctionHelper.getUid());//DISTRIBUTED_ID
            item.setIsArchive("FALSE");
            item.setSubjectLifeCycle("CURRENTLY_VALID");
            item.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
            item.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
            item.setReleaseInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
            item.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
            item.setCreateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
            item.setReleaseTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
            item.setIsValid("FALSE");
            item.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            item.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
            return item;
        }).collect(Collectors.toList()));
    }

    /**
     * 3-3-07查询执行周期阶段列表（开始小于等于&结束大于）[3201]
     * gen by moon at 6/21/2023, 3:24:31 AM
     */
    @Trace(operationName = "3-3-07查询执行周期阶段列表（开始小于等于&结束大于）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> queryExecuteCycleStageList(QueryExecuteCycleStageListReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            // TODO: 2023/3/7
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.le("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.gt("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByDesc("order_number");
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * M-构造单条执行周期阶段验证数据[4253]
     * gen by moon at 10/16/2022, 7:13:33 AM
     */
    @Trace(operationName = "M-构造单条执行周期阶段验证数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public String buildSingleExecuteCycleStage(OmsExecuteCycleStage omsExecuteCycleStage) {
        omsExecuteCycleStage.setExecuteCycleStageId(CommonFunctionHelper.getUid());//DISTRIBUTED_ID
        omsExecuteCycleStage.setIsArchive("FALSE");
        omsExecuteCycleStage.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        omsExecuteCycleStage.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        if (omsExecuteCycleStage != null && omsExecuteCycleStage.getSubjectLifeCycle() != null && omsExecuteCycleStage.getSubjectLifeCycle().equals("CURRENTLY_VALID")) {
            omsExecuteCycleStage.setReleaseInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//RELEASED_CURRENT_INDUCTIONID
        }
        omsExecuteCycleStage.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        omsExecuteCycleStage.setCreateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        if (omsExecuteCycleStage != null && omsExecuteCycleStage.getSubjectLifeCycle() != null && omsExecuteCycleStage.getSubjectLifeCycle().equals("CURRENTLY_VALID")) {
            omsExecuteCycleStage.setReleaseTime(CommonFunctionHelper.getCurrentTime());//RELEASE_SYSTEM_CURRENT_TIME
        }
        omsExecuteCycleStage.setIsValid("FALSE");
        omsExecuteCycleStage.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
        omsExecuteCycleStage.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
        if (super.save(omsExecuteCycleStage)) {
            return omsExecuteCycleStage.getExecuteCycleStageId();
        } else {
            return "-1";
        }

    }

    /**
     * M-查询目标周期详情[4260]
     * gen by moon at 3/30/2023, 12:38:49 PM
     */
    @Trace(operationName = "M-查询目标周期详情")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsExecuteCycleStage queryTargetCycleDetail(OmsExecuteCycleStage omsExecuteCycleStage) {

        try {

            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(omsExecuteCycleStage);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsExecuteCycleStage> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsExecuteCycleStage retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * M3-3-07查询执行周期阶段列表[4288]
     * gen by moon at 4/16/2024, 7:02:45 PM
     */
    @Trace(operationName = "M3-3-07查询执行周期阶段列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> queryExecuteCycleStageTestList(QueryExecuteCycleStageTestListReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByDesc("order_number");
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * M3-查询单条执行周期阶段[4298]
     * gen by moon at 3/30/2023, 12:38:50 PM
     */
    @Trace(operationName = "M3-查询单条执行周期阶段")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsExecuteCycleStage querySingleExecuteCycleStageDetail(QuerySingleExecuteCycleStageDetailReq reqDto) {

        try {
            reqDto.setIsValid("FALSE");
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsExecuteCycleStage> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsExecuteCycleStage retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07查询子周期范围内执行周期阶段列表[4718]
     * gen by moon at 9/26/2022, 10:07:16 PM
     */
    @Trace(operationName = "3-3-07查询子周期范围内执行周期阶段列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @BanAuto
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> querySubCycleExecuteCycleStageList(QuerySubCycleExecuteCycleStageListReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID

            if (reqDto.getCycleStartTime() != null) {
                queryWrapper.ge("cycle_start_time", reqDto.getCycleStartTime());
                reqDto.setCycleStartTime(null);

            }

            if (reqDto.getCycleEndTime() != null) {
                queryWrapper.le("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleEndTime(null);
            }
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07删除执行周期阶段[4932]
     * gen by moon at 10/20/2022, 12:17:20 PM
     */
    @Trace(operationName = "3-3-07删除执行周期阶段")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean deleteExecuteCycleStage(String executeCycleStageId) {

        return super.removeById(executeCycleStageId);
    }

    /**
     * 3-3-07批量查询执行周期阶段列表ByCodes[4976]
     * gen by moon at 4/18/2023, 11:12:53 PM
     */
    @Trace(operationName = "3-3-07批量查询执行周期阶段列表ByCodes")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> batchQueryExecuteCycleStageListByCodes(BatchQueryExecuteCycleStageListByCodesReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            if (reqDto.getCycleTypeList() == null || reqDto.getCycleTypeList().isEmpty()) {
                return new ArrayList<>();
            }

            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.gt("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.le("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }
            queryWrapper.in("cycle_type_code", reqDto.getCycleTypeList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07查询时间匹配执行周期详情[4986]
     * gen by moon at 3/30/2023, 12:38:51 PM
     */
    @Trace(operationName = "3-3-07查询时间匹配执行周期详情")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsExecuteCycleStage queryTimeMatchExecCycleDetail(QueryTimeMatchExecCycleDetailReq reqDto) {

        try {
            reqDto.setIsValid("FALSE");
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsExecuteCycleStage> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsExecuteCycleStage retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07批量查询执行周期阶段列表ByIds[5234]
     * gen by moon at 11/20/2022, 1:11:25 AM
     */
    @Trace(operationName = "3-3-07批量查询执行周期阶段列表ByIds")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> batchQueryExecuteCycleStageListByIds(BatchQueryExecuteCycleStageListByIdsReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            if (reqDto.getExecuteCycleStageList() == null || reqDto.getExecuteCycleStageList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("relate_execute_cycle_stage_id", reqDto.getExecuteCycleStageList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07时间切片查询执行周期阶段列表[5982]
     * gen by moon at 2/24/2023, 4:39:59 AM
     */
    @Trace(operationName = "3-3-07时间切片查询执行周期阶段列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    @BanAuto
    public List<OmsExecuteCycleStage> queryListByTimeSliceExecuteCycleStage(QueryListByTimeSliceExecuteCycleStageReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.ge("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.le("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            queryWrapper.orderByDesc("order_number");
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07批量查询时间范围内执行周期By周期ID[6008]
     * gen by moon at 3/2/2023, 11:38:16 PM
     */
    @Trace(operationName = "3-3-07批量查询时间范围内执行周期By周期ID")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    @BanAuto
    public List<OmsExecuteCycleStage> batchQueryTimeRangeExecuteCycleStageByCycleId(BatchQueryTimeRangeExecuteCycleStageByCycleIdReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.le("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.ge("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            if (reqDto.getCycleList() == null || reqDto.getCycleList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("cycle_id", reqDto.getCycleList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07时间匹配执行周期列表（开始大于&结束小于等于）[6321]
     * gen by moon at 6/21/2023, 3:24:34 AM
     */
    @Trace(operationName = "3-3-07时间匹配执行周期列表（开始大于&结束小于等于）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> queryTimeMatchExecCycleList2(QueryTimeMatchExecCycleList2Req reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            // TODO: 2023/5/14
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.gt("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.le("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07-批量查询执行周期阶段列表By目标周期ID[6508]
     * gen by moon at 5/8/2023, 10:58:51 PM
     */
    @Trace(operationName = "3-3-07-批量查询执行周期阶段列表By目标周期ID")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> batchQueryExecuteCycleStageListByTargetCycleIds(BatchQueryExecuteCycleStageListByTargetCycleIdsReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();

            if (reqDto.getEvaObjTargetCycleList() == null || reqDto.getEvaObjTargetCycleList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("eva_obj_target_cycle_id", reqDto.getEvaObjTargetCycleList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07查询执行周期阶段（结束时间）[6528]
     * gen by moon at 5/8/2023, 10:58:54 PM
     */
    @Trace(operationName = "3-3-07查询执行周期阶段（结束时间）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsExecuteCycleStage queryExecuteCycleStageByEndTimeDetail(QueryExecuteCycleStageByEndTimeDetailReq reqDto) {

        try {
            reqDto.setIsValid("FALSE");
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsExecuteCycleStage> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsExecuteCycleStage retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07-查询执行周期列表（开始大于等于&结束小于）[6660]
     * gen by moon at 5/14/2023, 2:49:32 AM
     */
    @Trace(operationName = "3-3-07-查询执行周期列表（开始大于等于&结束小于）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> queryExecuteCycleGreaterAndEqualStartList(QueryExecuteCycleGreaterAndEqualStartListReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            // TODO: 2023/5/14
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.ge("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.lt("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07-查询执行周期列表（开始大于&结束小于等于）[6661]
     * gen by moon at 5/14/2023, 2:49:36 AM
     */
    @Trace(operationName = "3-3-07-查询执行周期列表（开始大于&结束小于等于）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> queryExecuteCycleGreaterStartList(QueryExecuteCycleGreaterStartListReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            // TODO: 2023/5/14
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.gt("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.le("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07查执行周期By起止时间[6704]
     * gen by moon at 5/15/2023, 10:14:13 PM
     */
    @Trace(operationName = "3-3-07查执行周期By起止时间")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsExecuteCycleStage queryExecuteCycleByStartEndTimeDetail(QueryExecuteCycleByStartEndTimeDetailReq reqDto) {

        try {
            reqDto.setIsValid("FALSE");

            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            // TODO: 2023/5/21
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.ge("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.le("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsExecuteCycleStage> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsExecuteCycleStage retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-7查询执行周期列表（开始时间小于&结束时间大于）[6900]
     * gen by moon at 6/20/2023, 10:06:40 AM
     */
    @Trace(operationName = "3-3-7查询执行周期列表（开始时间小于&结束时间大于）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> queryExecuteCycleSmallStartList(QueryExecuteCycleSmallStartListReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            // TODO: 2023/5/22
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.lt("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.gt("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            reqDto.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07时间范围查询执行周期列表（开始小于等于&结束大于等于）[7222]
     * gen by moon at 7/16/2023, 5:44:47 AM
     */
    @Trace(operationName = "3-3-07时间范围查询执行周期列表（开始小于等于&结束大于等于）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> queryExecuteCycleLessStartBIgEndList(QueryExecuteCycleLessStartBIgEndListReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            // TODO: 2023/6/20  
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.le("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.ge("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByDesc("order_number");
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * （无调用）3-3-07-查执行周期时间详情（开始小于等于&结束大于等于）[7281]
     * gen by moon at 5/25/2024, 4:48:09 PM
     */
    @Trace(operationName = "（无调用）3-3-07-查执行周期时间详情（开始小于等于&结束大于等于）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsExecuteCycleStage queryExecuteCycleLessStartBIgEndDetail(QueryExecuteCycleLessStartBIgEndDetailReq reqDto) {

        try {
            reqDto.setIsValid("FALSE");

            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            // TODO: 2023/6/20
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.le("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.ge("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsExecuteCycleStage> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsExecuteCycleStage retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07查执行周期时间范围详情（开始小于等于&结束大于等于）[7505]
     * gen by moon at 4/12/2024, 6:27:50 PM
     */
    @Trace(operationName = "3-3-07查执行周期时间范围详情（开始小于等于&结束大于等于）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsExecuteCycleStage queryExecuteCycleBigStartLessEndDetail(QueryExecuteCycleBigStartLessEndDetailReq reqDto) {

        try {
            reqDto.setIsValid("FALSE");
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();

            // TODO: 2023/10/22
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.le("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.ge("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());

            queryWrapper.orderByDesc("create_time");
            List<OmsExecuteCycleStage> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsExecuteCycleStage retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * （无调用）3-3-07-查询执行周期时间范围详情（开始大于&结束大于）[7595]
     * gen by moon at 5/25/2024, 4:48:12 PM
     */
    @Trace(operationName = "（无调用）3-3-07-查询执行周期时间范围详情（开始大于&结束大于）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsExecuteCycleStage queryExecuteCycleBigStartBIgEndDetail(QueryExecuteCycleBigStartBIgEndDetailReq reqDto) {

        try {
            reqDto.setIsValid("FALSE");
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            // TODO: 2023/10/22
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.gt("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.gt("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsExecuteCycleStage> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsExecuteCycleStage retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07查询执行周期阶段（时间从大到小）列表[8594]
     * gen by moon at 3/14/2024, 3:17:07 AM
     */
    @Trace(operationName = "3-3-07查询执行周期阶段（时间从大到小）列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> queryExecuteCycleByTimeBigtoSmallList(QueryExecuteCycleByTimeBigtoSmallListReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByAsc("order_number");
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07批量查询执行周期by评价模板[8776]
     * gen by moon at 3/26/2024, 1:03:34 AM
     */
    @Trace(operationName = "3-3-07批量查询执行周期by评价模板")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> batchQueryExecuteCycleByEvaTemp(BatchQueryExecuteCycleByEvaTempReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");
            if (reqDto.getExecuteCycleStageList() == null || reqDto.getExecuteCycleStageList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("evaluation_template_id", reqDto.getExecuteCycleStageList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);
            queryWrapper.orderByDesc("eva_temp_create_time");
            queryWrapper.orderByDesc("order_number");
            queryWrapper.orderByDesc("operate_time");
            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07查询执行周期详情（开始小于等于&结束时间大于等于）[9464]
     * gen by moon at 4/30/2024, 1:48:44 AM
     */
    @Trace(operationName = "3-3-07查询执行周期详情（开始小于等于&结束时间大于等于）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsExecuteCycleStage queryExecuteCycleEqualStartrAndGreateDetail(QueryExecuteCycleEqualStartrAndGreateDetailReq reqDto) {

        try {

            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();

            // TODO: 2024/5/24
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.le("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.ge("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsExecuteCycleStage> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsExecuteCycleStage retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07查询执行周期阶段详情（开始小于等于&结束大于等于）[9657]
     * gen by moon at 5/25/2024, 1:18:35 PM
     */
    @Trace(operationName = "3-3-07查询执行周期阶段详情（开始小于等于&结束大于等于）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsExecuteCycleStage queryExecuteCycleLessStartBigEqualEndDetail(QueryExecuteCycleLessStartBigEqualEndDetailReq reqDto) {

        try {
            reqDto.setIsValid("FALSE");
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            // TODO: 2024/5/24
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.le("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.ge("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }

            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsExecuteCycleStage> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsExecuteCycleStage retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07查询执行周期阶段详情（开始小于等于&结束大于等于）[9658]
     * gen by moon at 6/14/2024, 6:28:47 PM
     */
    @Trace(operationName = "3-3-07查询执行周期阶段详情（开始小于等于&结束大于等于）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsExecuteCycleStage queryExecuteCycleLessEqualStartBigEndDetail(QueryExecuteCycleLessEqualStartBigEndDetailReq reqDto) {

        try {
            reqDto.setIsValid("FALSE");
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();

            // TODO: 2024/5/24
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.le("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.ge("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsExecuteCycleStage> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsExecuteCycleStage retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07查询执行周期时间范围（开始小于等于&结束大于）详情[9800]
     * gen by moon at 6/14/2024, 6:28:51 PM
     */
    @Trace(operationName = "3-3-07查询执行周期时间范围（开始小于等于&结束大于）详情")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsExecuteCycleStage queryExecuteCycleLessEqualStartBigDetail(QueryExecuteCycleLessEqualStartBigDetailReq reqDto) {

        try {
            reqDto.setIsValid("FALSE");
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();


            // TODO: 2024/6/15
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.le("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.gt("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsExecuteCycleStage> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsExecuteCycleStage retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07查询执行周期列表（开始小于&结束大于等于）[9838]
     * gen by moon at 6/20/2024, 9:48:21 PM
     */
    @Trace(operationName = "3-3-07查询执行周期列表（开始小于&结束大于等于）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> queryExecuteCycleLessStartAndGreaterEqualStartList(QueryExecuteCycleLessStartAndGreaterEqualStartListReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();
            reqDto.setIsValid("FALSE");

            // TODO: 2024/6/21
            if (reqDto.getCycleStartTime() != null && reqDto.getCycleEndTime() != null) {
                queryWrapper.lt("cycle_start_time", reqDto.getCycleStartTime());
                queryWrapper.ge("cycle_end_time", reqDto.getCycleEndTime());
                reqDto.setCycleStartTime(null);
                reqDto.setCycleEndTime(null);
            }
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-3-07批量查询执行周期阶段By内容ID列表[9962]
     * gen by moon at 7/14/2024, 6:16:33 PM
     */
    @Trace(operationName = "3-3-07批量查询执行周期阶段By内容ID列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsExecuteCycleStage> batchQueryExecuteCycleByContIdListByIds(BatchQueryExecuteCycleByContIdListByIdsReq reqDto) {

        try {
            QueryWrapper<OmsExecuteCycleStage> queryWrapper = new QueryWrapper<>();

            if (reqDto.getExecuteCycleStageList() == null || reqDto.getExecuteCycleStageList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("relate_content_id", reqDto.getExecuteCycleStageList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsExecuteCycleStage.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsExecuteCycleStage.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsExecuteCycleStage>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

}

